package com.springboot.test;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.Assert;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
public class CustomerTicket {
    @Id
    private Long id;
    private String orderNumber;
    private String description;
    private Date createTime;
    
        
    public CustomerTicket(Long accountId, String orderNumber) {
        super();
        
        Assert.notNull(accountId, "Account Id must not be null");
        Assert.notNull(orderNumber, "Order Number must not be null");
        Assert.isTrue(orderNumber.length() == 10, "Order Number must be exactly 10 characters");
 
        this.orderNumber = orderNumber;
    }
}